package net.cloudsun.graph.puzzle;

/**
 * created at 23/11/2021
 * 修改记录
 * <ol>
 *     <li>2021年11月25日 修改类名</li>
 * </ol>
 *
 * @author 俞建波
 * <a href="mailto://yujianbo@chtwm.com">yujianbo@chtwm.com</a>
 * @since
 */
public enum PuzzlePosition {
    TOP_LEFT(0, 0), TOP_RIGHT(0, 1),
    BOTTOM_LEFT(1, 0), BOTTOM_RIGHT(1, 1);
    private final int startRow;
    private final int startColumn;

    PuzzlePosition(int startRow, int startColumn) {
        this.startRow = startRow;
        this.startColumn = startColumn;
    }

    public PuzzlePosition reverse() {
        switch (this) {
            case TOP_LEFT:
                return BOTTOM_RIGHT;
            case TOP_RIGHT:
                return BOTTOM_LEFT;
            case BOTTOM_LEFT:
                return TOP_RIGHT;
            case BOTTOM_RIGHT:
                return TOP_LEFT;
            default:
                return null;
        }
    }

    public int getStartRow() {
        return startRow;
    }

    public int getStartColumn() {
        return startColumn;
    }
}
